import { request } from "@/utils/service"
import { getToken } from "@/utils/cache/cookies"

/**套餐推荐相关 */
/** 增 */
export function createCollectionDataApi(data: any) {
  return request({
    url: "/h5/packTj/add",
    method: "post",
    data
  })
}
/** 克隆 */
export function cloenCollectionDataApi(data: any) {
  return request({
    url: "/h5/packTj/copy",
    method: "post",
    headers: {
      "Content-Type": "multipart/form-data",
      token: getToken()
    },
    data
  })
}

/** 删 */
export function deleteCollectionDataApi(id: string) {
  return request({
    url: "/h5/packTj/del",
    method: "delete",
    params: {
      id
    }
  })
}

/** 改 */
export function updateCollectionDataApi(data: any) {
  return request({
    url: "/h5/packTj/update",
    method: "put",
    data
  })
}

/** 查 */
export function getCollectionDataApi(params: any) {
  return request<any>({
    url: "/h5/packTj/query",
    method: "get",
    params
  })
}
/**套餐合集子套餐相关 */
/** 增 */
export function createCollectionChild(data: any) {
  return request({
    url: "/h5/packTjInfo/add",
    method: "post",
    data
  })
}

/** 删 */
export function deleteCollectionChild(id: string) {
  return request({
    url: "/h5/packTjInfo/del",
    method: "delete",
    params: {
      id
    }
  })
}

/** 改 */
export function updateCollectionChild(data: any) {
  return request({
    url: "/h5/packTjInfo/update",
    method: "put",
    data
  })
}

/** 查 */
export function getCollectionChild(params: any) {
  return request<any>({
    url: "/h5/packTjInfo/query",
    method: "get",
    params
  })
}

/**h5合集页移动端 */
export function getCollectionH5List(params: any) {
  return request<any>({
    url: "/h5/packTj/queryInfo",
    method: "get",
    params
  })
}
/**h5合集批量配置 */
export function createCollectionChilds(data: any) {
  return request({
    url: "/h5/packTj/plAdd",
    method: "post",
    data
  })
}
